//
//  TMGGuideViewController.m
//  TMGold
//
//  Created by Mac on 2018/3/19.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGuideViewController.h"
//#import "TMLoginViewController.h"
#import "TMGuideViewController.h"
@interface TMGuideViewController ()
@property(nonatomic, strong) STAdvertingScrollView                     *adverView;
@end

@implementation TMGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    
    self.adverView = [[STAdvertingScrollView alloc] initWithFrame:UIScreenFrame andWithArray:@[@"00-引导页-1",@"00-引导页-2",@"00-引导页-3"] handle:^(NSInteger num) {
        if (num == 10002) {
            UIWindow * window =  UIApplication.sharedApplication.delegate.window ;
            STNavigationController * nav = [[STNavigationController alloc] initWithRootViewController:OELoginHomeViewController.new];
            window.rootViewController = nav;
            [window st_showAnimationWithType:STAnimationTypekCATransitionFade];

            [[UIApplication sharedApplication].keyWindow st_showAnimationWithType:STAnimationTypekCATransitionFade];
            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:isShowGuideKey];
        }
    }];
    self.adverView.pageControll.bottom = self.adverView.height - 30;
    self.adverView.pageControll.currentPageIndicatorTintColor = [UIColor whiteColor];
    self.adverView.pageControll.pageIndicatorTintColor = FlatYellow;
    self.adverView.pageControll.centerX = UIScreenWidth / 2;
    self.adverView.pageControll.hidden = YES;
    self.adverView.canAutoScroll = NO;
    [self.view addSubview:self.adverView];
}

@end
